# coding = utf-8

from django.urls import path
from rest_framework.routers import DefaultRouter

from member.api.stats_views import PointMonthStatsAPIView
from member.api.views import RetailerImageUploadAPIView, RetailerViewSet, RetailerImageViewSet, BonusPointViewSet, \
    PointConsumptionViewSet, EmployeeViewSet, RetailerListAPIView, BonusStatsAPIView, ConsumeStatsAPIView, \
    RetailerPermissionViewSet, RetailerRoleViewSet, RetailerPermsListAPIView, RetailerRoleListAPIView
from member.api.wechat_views import WxRetailerImageUploadAPIView, WxRetailerViewSet, WxRetailerImageViewSet, \
    WxRetailerInfo, WxBonusPointAPIView, WxBonusPointViewSet, WxEmployeeAuthAPIView, WxConsumePointAPIView, \
    WxPointConsumptionViewSet, WxContactImageUploadAPIView, WxEmployeeViewSet, WxBonusPointCancelAPIView, \
    WxBonusStatsAPIView, WxRoleViewSet, WxPermissionViewSet, WxRolePermissionViewSet, WxAdminPermissionViewSet, \
    WxUserInfoAPIView, WxUserInfoListView

router = DefaultRouter()
router.register(r'retailer', RetailerViewSet, basename="retailer")
router.register(r'retailer_image', RetailerImageViewSet, basename="retailer-image")
router.register(r'bonus_point', BonusPointViewSet, basename="bonus-point")
router.register(r'point_consumption', PointConsumptionViewSet, basename="point-consumption")
router.register(r'employee', EmployeeViewSet, basename="retailer-employee")
router.register(r'retailer_permission', RetailerPermissionViewSet, basename="retailer-permission")
router.register(r'retailer_role', RetailerRoleViewSet, basename="retailer-role")
# 微信
router.register(r'wx_retailer', WxRetailerViewSet, basename="wx-retailer")
router.register(r'wx_retailer_image', WxRetailerImageViewSet, basename="wx-retailer-image")
router.register(r'wx_bonus_point_list', WxBonusPointViewSet, basename="wx-bonus-point-list")
router.register(r'wx_consume_point_list', WxPointConsumptionViewSet, basename="wx-consume-point")
router.register(r'wx_employee', WxEmployeeViewSet, basename="wx-employee")
router.register(r'wx_permission', WxPermissionViewSet, basename="wx-permission")
router.register(r'wx_role', WxRoleViewSet, basename="wx-role")
# 微信
router.register(r'wx_role_permission', WxRolePermissionViewSet, basename="wx-role-permission")
router.register(r'wx_admin_permission', WxAdminPermissionViewSet, basename="wx-admin-permission")

urlpatterns = [
    path('retailer_list/', RetailerListAPIView.as_view(), name="api-retailer-list"),
    path('image_upload/', RetailerImageUploadAPIView.as_view(), name="api-retailer-image-upload"),
    path('wx_image_upload/', WxRetailerImageUploadAPIView.as_view(), name="api-wx-retailer-image-upload"),
    path('wx_contact_upload/', WxContactImageUploadAPIView.as_view(), name="api-wx-contact-image-upload"),
    path('wx_retailer_info/', WxRetailerInfo.as_view(), name="api-wx-retailer-info"),
    path('wx_bonus_point/', WxBonusPointAPIView.as_view(), name="api-wx-bonus-point"),
    path('wx_employee_auth/', WxEmployeeAuthAPIView.as_view(), name="api-wx-employee-auth"),
    path('wx_consume_point/', WxConsumePointAPIView.as_view(), name="api-wx-consume-point"),
    path('wx_bonus_point_cancel/', WxBonusPointCancelAPIView.as_view(), name="api-bonus-point-cancel"),
    path('wx_bonus_stats/', WxBonusStatsAPIView.as_view(), name="api-wx-bonus-stats"),
    path('wx_user_info/', WxUserInfoAPIView.as_view(), name="api-wx-user-info"),
    path('wx_user_list/', WxUserInfoListView.as_view(), name="api-wx-user-info-list"),
    # 后台
    path('bonus_stats/', BonusStatsAPIView.as_view(), name="api-bonus-stats"),
    path('consume_stats/', ConsumeStatsAPIView.as_view(), name="api-consume-stats"),
    path('point_month_stats/', PointMonthStatsAPIView.as_view(), name="api-point-month-stats"),
    path('retailer_perms_list/', RetailerPermsListAPIView.as_view(), name="api-retailer-perms-list"),
    path('retailer_role_list/', RetailerRoleListAPIView.as_view(), name="api-retailer-role-list"),

]
urlpatterns += router.urls
